import 'dart:ui';

import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/cupertino.dart';
import 'package:www.znpigai.teacher/global_store/state.dart';

enum LoginMode { REGISTER, LOGIN, RESET, CHANGE_MOBILE }

class LoginState implements GlobalBaseState, Cloneable<LoginState> {
  var mode = LoginMode.LOGIN;
  var accountController = TextEditingController();
  var nameController = TextEditingController();
  var ganderValue = 'male';
  var counter = 0;
  var password = '';
  var code = '';

  LoginState(Map<dynamic, dynamic> args) {
    if (args == null) {
      mode = LoginMode.LOGIN;
    } else {
      mode = args['mode'] ?? LoginMode.LOGIN;
    }
//    if (GlobalState.isInDebugMode) {
//      account = '18900000020';
//      password = '1';
//    }
  }

  @override
  LoginState clone() {
    return LoginState(null)
      ..mode = mode
      ..accountController = accountController
      ..nameController = nameController
      ..counter = counter
      ..password = password
      ..code = code;
  }

  @override
  Color themeColor;

  @override
  Map<String, dynamic> userInfo;
}

LoginState initState(Map<String, dynamic> args) {
  return LoginState(args);
}
